package com.tsu.mall.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tsu.mall.common.entity.Bill;
import com.tsu.mall.common.entity.Member;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CountMapper {

    @Select("select status,count(1) as num from ${source} where join_time between #{firstTime} and #{secondTime} GROUP BY status")
    List<Member> doCountList(String source, String firstTime, String secondTime);

    @Select("select status,count(1) as num,sum(price) as sumPrice from ${source} where create_time between #{firstTime} and #{secondTime} group by status")
    List<Bill> doBillCountList(String source, String firstTime, String secondTime);
}
